/*
 * PopupCanvassVoteMsg.hpp
 *
 *  Created on: Jul 17, 2012
 *      Author: guillou
 */

#ifndef POPUPCANVASSVOTEMSG_HPP_
#define POPUPCANVASSVOTEMSG_HPP_

#include <PopupLibTypes.hpp>
#include "PopupAbstractMessage.hpp"

namespace Popup
{
  struct CanvassVoteMsg : public AbstractMessage, public Vote
  {
    enum
    {
      CANVASS_ID,
      VOTER,
      TARGETS,
      CHOICES
    };

    //! Constructor used in order to send a message
    CanvassVoteMsg(const Vote & p_vote,
                   const UserList & p_targets)
     : AbstractMessage(POPUP_MSG_TYPE_CANVASS_VOTE),
       Vote(p_vote), targets(p_targets) {}

    //! Constructor used in order to receive a message
    CanvassVoteMsg(const Message *p_message);

    virtual ~CanvassVoteMsg() {}

    //! @Override
    bool onSend();

    //! @Override
    bool onReceive();


    //! Other participants
    UserList targets;
  };
}

#endif /* POPUPCANVASSVOTEMSG_HPP_ */
